package com.training.java.core.collections.car.pre15;

// A laptop class has been created to perform immutable function.
// Here constructors have been created followed by getters method in this class.

public class Laptop {
	String company;
	String model;
	String operatingSystem;
	String proecessor;

	/**
	 * @param company
	 * @param model
	 * @param operatingSystem
	 * @param proecessor
	 */
	public Laptop() {

	}

	public Laptop(String company, String model, String proecessor) {
		super();
		this.company = company;
		this.model = model;
		this.operatingSystem = operatingSystem;
		this.proecessor = proecessor;
	}

	public String getCompany() {
		return company;
	}

	public String getModel() {
		return model;
	}

	public String getOperatingSystem() {
		return operatingSystem;
	}

	public String getProecessor() {
		return proecessor;
	}

	/**
	 * @param operatingSystem
	 *            the operatingSystem to set
	 */
	public void setOperatingSystem(String operatingSystem) {
		this.operatingSystem = operatingSystem;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Laptop) {
			Laptop laptop = (Laptop) obj;
			return ((this.getCompany().equals(laptop.getCompany())) && (this
					.getModel().equals(laptop.getModel())));
		} else
			return false;
	}

}
